package com.example.child_protection.dto.request.update;

import com.example.child_protection.dto.base.BaseUpdateRequestDTO;
import com.example.child_protection.enums.AttrTypeEnums;
import com.example.child_protection.enums.BooleanEnums;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;

/**
 * 属性修改请求DTO
 * @date 2018-11-1
 * @author Biz
 */
@Getter
@Setter
public class AttrUpdateRequestDTO extends BaseUpdateRequestDTO {

    /**
     * 属性代码
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "属性代码",required = true)
    private String attrCode;

    /**
     * 属性名称
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "属性名称",required = true)
    private String attrName;

    /**
     * 元素类型
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "元素类型",required = true)
    private AttrTypeEnums attrType;

    /**
     * 单位
     *
     * @mbggenerated
     */
    @ApiParam(value = "元素单位")
    private String attrUnit;

    /**
     * 是否多选
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "是否可多选",required = true)
    private BooleanEnums isMulti = BooleanEnums.F;

    /**
     * 状态(是否显示)
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "是否前端显示",required = true)
    private BooleanEnums status = BooleanEnums.T;

    /**
     * 是否有属性值
     *
     * @mbggenerated
     */
    @NotNull
    @ApiParam(value = "是否有属性值",required = true)
    private BooleanEnums isAttribute = BooleanEnums.F;

    /**
     * 属性值类型
     *
     * @mbggenerated
     */
    @ApiParam(value = "属性值类型",hidden = true)
    private String attributeType;
    public void valid(){

        super.validate( this, new Class[0] );
    }
    public boolean isValidGid() {

        return false;
    }

}
